
FROM python:3.7.9-slim-stretch
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
RUN sed -i 's/security.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
ENV PYTHONUNBUFFERED 1
RUN mkdir /code/template -p
WORKDIR /code

RUN apt-get update; apt-get install git libmariadbd-dev build-essential -y

ADD py_app_models/requirments.txt /code/requirments.txt
RUN pip3 install -r requirments.txt -i https://pypi.douban.com/simple
COPY ./main /code
CMD ./main